/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.capex.javacore.algoritmo;

/**
 *
 * @author Acer
 */
public class Palindrome {

    public static void checkPalindrome(String str){
        int length = str.length();
        for (int i= 0, j = str.length()-1; i < length/2; i++) {

            if(!(str.charAt(i)==str.charAt(j))){
                System.out.println("Not Palindrome");
                return;
            }
                j--;
        }

        System.out.println("Is Palindrome");

    }

    public static void main(String[] args) {
        String madam = "madam";
        Palindrome.checkPalindrome(madam);
    }
}
